<?php

/*
 Website Baker Project <http://www.websitebaker.org/>
 Copyright (C) 2004-2007, Ryan Djurovich

 Website Baker is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 Website Baker is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with Website Baker; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

include("../../config.php");

echo'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>Icons</title>
<script type="text/javascript">

	function returnIconId(id,image)
	{
		window.opener.document.getElementById("icon_id").value= id;
		window.opener.document.getElementById("icon_preview").src= image;
		
		window.close();	
	}


</script>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
</head>
<body>';
echo '<table border="0"><tr>';
$query = "SELECT * FROM `".TABLE_PREFIX."mod_map_icons`";
$result = mysql_query($query);
if (mysql_num_rows($result) > 0) {
	$a = 0;
	while($settings = mysql_fetch_assoc($result)) {
		if (stristr($settings['icon'],'[gmap-markers]')) {
			$gmapmatkerpath = WB_URL.MEDIA_DIRECTORY.'/gmap-markers';
			$settings['icon'] = str_replace('[gmap-markers]', $gmapmatkerpath, $settings['icon']);
		}
		echo '<td align="center"><a href="javascript: returnIconId(\''.$settings['icon_id'].'\',\''.$settings['icon'].'\');"><img src="'.$settings['icon'].'" border="0" /></a></td>';
		$a++;
		if ($a == 8) {
			echo "</tr>\n<tr>";
			$a = 0;
		}
	}
}
echo '</tr></table>';
echo '</body></html>';
?>
